import request from '@/utils/request'

/**
 *
 * @params{
    "name": "",
  }
 */
// 添加商家类型
export function addType(data) {
  return request({
    url: '/business/insert-business-type',
    method: 'post',
    data
  })
}
/**
 *
 */
// 删除商家类型
export function deleteTypeById(data) {
  return request({
    url: '/business/delete-business-type',
    method: 'post',
    data
  })
}

/**
 *
 * @params{
	"id": 0,
	"name": "",
}
 */
// 修改商家类型
export function updateType(data) {
  return request({
    url: '/business/update-business-type',
    method: 'post',
    data
  })
}
// 查询商家类型 不分页
export function getTypeList(data) {
  return request({
    url: '/business/list-business-type',
    method: 'post',
    data
  })
}
/**
 *
 * @params{
    "name": "",
  }
 */
// 添加商家
export function addBusiness(data) {
  return request({
    url: '/business/insert',
    method: 'post',
    data
  })
}
/**
 *
 */
// 删除商家
export function deleteBusinessById(data) {
  return request({
    url: '/business/delete',
    method: 'post',
    data
  })
}

/**
 *
 * @params{
	"id": 0,
	"name": "",
}
 */
// 修改商家
export function updateBusiness(data) {
  return request({
    url: '/business/update',
    method: 'post',
    data
  })
}
// 查询商家 分页
/**
 *
 * @param {
	"mobile": "",
	"name": "",
	"pageNo": 0,
	"pageSize": 0,
	"status": 0,
	"userId": ""
} data
 *
 */
export function getBusinessList(data) {
  return request({
    url: '/business/page',
    method: 'post',
    data
  })
}

// 查询创建人列表
export function getBusinessCreatorList(data) {
  return request({
    url: '/custom/custom-user-list',
    method: 'post',
    data
  })
}

// 设置优质客户
export function setBusinessStatus(data) {
  return request({
    url: '/business/update-status',
    method: 'post',
    data
  })
}
